package com.yingdong.message;

import java.util.Collection;

import com.yingdong.db.Usermotion;
import com.yingdong.opcode.ServerOpcode;
import com.yingdong.sceneserver.inner.message.SendBaseMessage;

public class MotionMessage extends SendBaseMessage {

	public MotionMessage(Collection<Usermotion> list) {
		super(ServerOpcode.MOTION);
		writeByte(list.size());
		for (Usermotion usermotion : list) {
			writeInt(usermotion.getActionId());
			writeInt(usermotion.getLevel());
		}
	}

	public MotionMessage(Usermotion usermotion) {
		super(ServerOpcode.MOTION);
		writeByte(1);
		writeInt(usermotion.getActionId());
		writeInt(usermotion.getLevel());

	}
}
